<?php
/**
 * Created by PhpStorm.
 * User: lzy
 * Date: 2018/11/21
 * Time: 16:04
 */
namespace App\FreeBird\Controllers\Home;
use App\Base\Controllers\Controller;
use App\FreeBird\Contracts\RebateLogInterface;
use Illuminate\Http\Request;

class RebateLogController extends Controller
{

    /**
     * 返佣列表
     * @return RebateLogInterface
     */
    public function getRebateLogInterface(){
        return app()->make(RebateLogInterface::class);
    }

    /**
     * 我的分销列表
     * @return mixed
     */
    public function getLogList(Request $request){
        $where=function($query) use ($request){
            $query->where("buid",AUID);
            $sourceType=$request->input("source_type");
            if(!empty($sourceType)){
                $query->where("source_type",$sourceType);
            }

        };
        return $this->getRebateLogInterface()->getListHomeAll($where);
    }

    public function getStatistics(){
        return $this->getRebateLogInterface()->getStatistics();
    }

}